<template>
    <div>
        <van-search v-model="value" show-action label="地址" placeholder="请输入搜索关键词" @search="onSearch">
            <template #action>
                <div @click="onClickButton">搜索</div>
            </template>
        </van-search>
    </div>
</template>

<script setup>
import { searchApi } from '@/api/api';
import { watch,ref } from 'vue';
let value=ref('')
watch(value,(val)=>{
    searchApi(val).then(res=>{
        console.log('搜索数据',res);
        
    })
})

</script>

<style lang="scss" scoped></style>